package etcMycat.controller;


import etcMycat.dto.Result;
import etcMycat.entity.ETCToSZ;
import etcMycat.service.CarInOutService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@Slf4j
@RestController
@RequestMapping("/rank")
public class CarInOutController {
    @Resource
    private CarInOutService carInOutService;

    @GetMapping("/in")
    public Result CarIn(){
        List<ETCToSZ> etcToSZS = carInOutService.rankIn();
        log.info("输出进入深圳车流量，并排序");
        return Result.success(etcToSZS);
    }

    @GetMapping("/out")
    public Result CarOut(){
        List<ETCToSZ> etcToSZS = carInOutService.rankOut();
        log.info("输出出深圳车流量，并排序");
        return Result.success(etcToSZS);
    }
}
